package com.ytjj.qmyx.supplychain.common.enums;

/**
 * @ClassName StatementTypeEnum
 * @Description 对账单类型
 *
 * 
 * @Version 1.0
 **/
public enum StatementTypeEnum {
    BILL_COLLECT(1,"本期账单汇总"),
    FINISH_ORDER(2, "本期已完成订单"),
    CLOSE_ORDER(3, "本期已关闭订单（应退）"),
    BEFORE_ORDER(4,"往期已结本期关闭订单（应退）")
    ;

    private Integer code;
    private String message;

    StatementTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(Integer code){
        for (StatementTypeEnum value : StatementTypeEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getMessage();
            }
        }
        return null;
    }

    public static Integer getCodeByMessage(String message){
        for (StatementTypeEnum value : StatementTypeEnum.values()) {
            if(value.getMessage().equals(message)){
                return value.getCode();
            }
        }
        return null;
    }
}
